﻿using Smobiler.Core;
using Smobiler.Core.Controls;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Xml.Linq;

namespace MesGLApp.View.Search
{
    ////ToolboxItem用于控制是否添加自定义控件到工具箱，true添加，false不添加
    //[System.ComponentModel.ToolboxItem(true)]
    partial class SiteIPQCDetail : Smobiler.Core.Controls.MobileUserControl
    {
        DataTable dt = new DataTable();
        public event Action<string> DataChanged;
        public SiteIPQCDetail() : base()
        { 
            InitializeComponent(); 
        } 
        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            var item = DataSource.Items.FirstOrDefault(i => i.Name == qc_name.Text);
            if (item != null)
            {
                item.Value = Value.Text;
            }
        }
        public class Name_Value
        {
            public string Name { get; set; }
            public string Value { get; set; }

            public Name_Value(string name, string value)
            {
                Name = name;
                Value = value;
            }
        }
        /// <summary>
        /// 共享数据源
        /// </summary>
        public static class DataSource
        {
            public static List<Name_Value> Items { get; set; } = new List<Name_Value>();
        }
    }
}